package com.umeox.stopwatch

import android.os.SystemClock

abstract class Ticker protected constructor() {
    abstract fun read(): Long

    companion object {
        private val SYSTEM_TICKER: Ticker = object : Ticker() {
            override fun read(): Long {
                return SystemClock.elapsedRealtimeNanos()
            }
        }


        fun systemTicker(): Ticker {
            return SYSTEM_TICKER
        }
    }
}
